var tools = [{
	id : '_refresh',
	handler : function(e, target, panel) {
		if(panel.autoLoad){
			panel.getUpdater().update(panel.autoLoad);
		}
	}
}];

//默认的portal类
DefaultPortal = function(config) {
	Ext.apply(this,config);
	var firstCol = new Ext.ux.PortalColumn({
		columnWidth : .33,
		style : 'padding:5px 0 5px 5px'
	});
	var secondCol = new Ext.ux.PortalColumn({
		columnWidth : .33,
		style : 'padding:5px 0 5px 5px'
	});
	var thirdCol = new Ext.ux.PortalColumn({
		columnWidth : .33,
		style : 'padding:5px 0 5px 5px'
	});
	

	
	//读取用户的门户配置数据
	var values = Utils.doSyncRequest(ctxPath+'/up/getUserPortlet.json',null,'POST');
	if(values && values.datas){
		var datas = values.datas;
		for(var i=0;i<datas.length;i++){
			var data = datas[i];
			var cmp = Ext.getCmp(data['portlet_id']);
			if(cmp){
				this.portletCounter.push(cmp);
				if(data['column_index'] == 1){
					//放入第一列
					firstCol.add(cmp);
				}else if(data['column_index'] == 2){
					//放入第二列
					secondCol.add(cmp);
				}else{
					//放入第三列
					thirdCol.add(cmp);
				}
			}
		}
	}
	
	var portalContainer = new Ext.ux.Portal({
		margins : '0 0 0 0',
		items : [firstCol, secondCol,thirdCol]
	});
	
	return new Ext.Viewport({
		layout : 'fit',
		items : [portalContainer]
	});
};

